﻿using ASmile.Com;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ASmile.Win.Forms
{
    public partial class FrmChangePwd : FrmBaseModal
    {
        public FrmChangePwd()
        {
            InitializeComponent();
        }

        protected virtual IMDIBLL BLLObj { get; } = ObjectFactory.GetObject<IMDIBLL>("MDIBLL");

        private void FrmChangePwd_Load(object sender, EventArgs e)
        {

        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            var ret =
            BLLObj.ChangePwd(new Com.MDI.ArgChangePwd 
            { 
                OldPwd = txtSrcPwd.Text,
                NewPwd1 = txtNewPwd1.Text,
                NewPwd2 = txtNewPwd2.Text
            });
            if (ret)
            {
                MessageBox.Show("修改密码成功");
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(ret.msg);
                this.Close();
            }
        }
    }
}
